package com.bruan.d5_zoneid_zonedatetime;

import java.time.Clock;
import java.time.ZoneId;
import java.time.ZonedDateTime;

public class ZoneId_ZoneDateTime {
    public static void main(String[] args) {
       ZoneId zoneId = ZoneId.systemDefault();
        System.out.println(zoneId.getId());
        System.out.println(zoneId.getId());
        System.out.println("_______________________");
        System.out.println(ZoneId.getAvailableZoneIds());
        System.out.println("_______________________");
        //绑定时区
        ZoneId zoneId1 = ZoneId.of("America/New_York");
        ZonedDateTime now = ZonedDateTime.now(zoneId1);
        System.out.println(now);

        ZonedDateTime now1 = ZonedDateTime.now(Clock.systemUTC());
        System.out.println(now1);

        ZonedDateTime now2 = ZonedDateTime.now();
        System.out.println(now2);

    }
}
